<template>
  <el-tree :data="menus" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</template>
<script>
  export default {
    data() {
      return {
        menus: [],
        defaultProps: {
          children: 'children',
          label: 'name'
        }
      };
    },
    methods: {
      getMenus(){
          this.dataListLoading = true
          this.$http({
            url: this.$http.adornUrl('/product/category/list/tree'),
            method: 'get'
          }).then(({data}) => {
             this.menus = data.data;
          })
      },
      handleNodeClick(data) {
        console.log(data);
      }
    },
    created () {
      this.getMenus()
    },
  };
</script>
<style scoped>

</style>
